var _util = require('util/util.js');

var _catalog_servcie = {

    getProductList : function (categoryId,resolve, reject) {
        _util.request({
            url: _util.getServerURL('catalog/categories/'+ categoryId + '/products'),
            success: resolve,
            error: reject,
        });
    },
    getItemList : function (productId,resolve, reject) {
        _util.request({
            url: _util.getServerURL('catalog/products/'+ productId + '/items'),
            success: resolve,
            error: reject,
        });
    },
    getItem : function (itemId,resolve, reject) {
        _util.request({
            url: _util.getServerURL('catalog/categories/items/'+ itemId),
            success: resolve,
            error: reject,
        });
    },

}

module.exports = _catalog_servcie;